package com.z.mapper;

import com.z.entity.Users;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.z.entity.security.Admin;
import com.z.result.ResultWrapper;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author zz
 * @since 2021-08-13
 */
@Mapper
public interface UsersMapper extends BaseMapper<Users> {

    @Select("select username loginacct  ,`password` userpswd,user_id id from users where username = #{username}; ")
    Admin selectAdminByUserName(String username);

    @Insert("insert into au_inner_user_role as aiur (user_id,role_id) values (#{id},#{rid})")
    Integer insertOneRole(@Param("id")Integer id, @Param("rid") Integer rid);
}
